<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>弹性盒子布局</title>
    <style>
        body {
            margin: 0;
            padding: 0;
        }

        header {
            background-color: blueviolet;
            height: 100px;
        }

        h1 {
            text-align: center;
            color: white;
            line-height: 100px;
            margin: 0;
        }

        article {
            padding: 10px;
            margin: 10px;
            background-color: aqua;
        }

        section {
            display: flex;
        }

        article {
            flex: 1 200px;
        }

        article:nth-of-type(3) {
            display: flex;
            flex: 3 300px;
            flex-flow: column;
        }

        article:nth-of-type(3) div:first-child {
            flex: 1 100px;
            display: flex;
            flex-flow: row wrap;
            align-items: center;
            justify-content: space-around;
            border: 2px solid red;
        }

        button {
            flex: 1 auto;
            margin: 5px;
            font-size: 18px;
            line-height: 1.5;
        }

        section:nth-of-type article {
            flex: 1;
        }
    </style>
</head>
<body>
<header>
    <h1>Sample flex box</h1>
    <section>
        <article>
            <h2> first article</h2>
            <p>
                this is world in the new this is world in the new this is world in the new this is world in the new
            </p>
        </article>
        <article>
            <h2> second article</h2>
            <p>
                this is world in the new this is world in the new this is world in the new this is world in the new
            </p>
        </article>
        <article>
            <div>
                <button>simple</button>
                <button>laugh</button>
                <button>wink</button>
                <button>shrug</button>
                <button>blush</button>
            </div>
            <p>
                this is world in the new this is world in the new this is world in the new this is world in the new
            </p>
        </article>
    </section>
    <hr>
    <section>
        <article>
            <h2> first article</h2>
            <p>
                this is world in the new this is world in the new this is world in the new this is world in the new
            </p>
        </article>
        <article>
            <div>
                <button>simple</button>
                <button>laugh</button>
                <button>wink</button>
                <button>shrug</button>
                <button>blush</button>
            </div>
        </article>
    </section>
    <style>
        #d1 {
            display: flex;
        }
        #d1 div {
            flex: 1 500;
            border: 2px solid red;
        }
        #d1 div:nth-of-type(3) {
            flex:3 100px;
        }
    </style>
    <div id="d1">
        <div>hello</div>
        <div>hello</div>
        <div>hello</div>
        <div>hello</div>
    </div>
</header>
</body>
</html>